define(function(require,exports,module){
	var $=require("jquery");
	exports.loadpage=function(){
		var timer=null;
		var pagelookheight=document.documentElement.clientHeight;
		
		window.onscroll=function(){
			var backtop=document.body.scrollTop;
			//只有下拉超过一屏才显示回到顶端
			if(backtop>=pagelookheight)
			{
				$("#backtotop").show();
			}
			else
			{
				$("#backtotop").hide();
			}
		};
		
		$("#backtotop").click(function(){
			timer=setInterval(function(){
				var mmTop=document.body.scrollTop;
				var mmSpeed=mmTop/5;
				document.body.scrollTop=mmTop-mmSpeed;
				if(document.body.scrollTop<=0)
				{
					clearInterval(timer);
				}
			},30);
		});
	};
});
